﻿Imports Microsoft.Xna.Framework

Namespace Global.Runa.UI.Metadata

    Public Class TypeConverter

        Public Property Game() As Game

        Public Sub New(g As Game)
            Me.Game = g
        End Sub

        Public Overridable Function ConvertToInvariantString(ByVal value As Object) As String
            Return value.ToString()
        End Function

        Public Overridable Function ConvertToString(ByVal value As Object) As String
            Return ConvertToInvariantString(value)
        End Function

        Public Overridable Function CreateInstance(ByVal propertyValues As IDictionary) As Object
            Throw New NotImplementedException()
        End Function

        Public Overridable Function ConvertFromInvariantString(ByVal [text] As String) As Object
            Return Nothing
        End Function

        Public Overridable Function ConvertFromString(ByVal [text] As String) As Object
            Return ConvertFromInvariantString([text])
        End Function

        Public Overridable Function GetCreateInstanceSupported() As Boolean
            Return False
        End Function

        Public Overridable Function GetPropertiesSupported() As Boolean
            Return False
        End Function

        Public Overridable Function GetStandardValuesSupported() As Boolean
            Return False
        End Function

        Public Overridable Function CanConvertFrom(ByVal sourceType As Type) As Boolean
            Return False
        End Function

        Public Overridable Function CanConvertTo(ByVal destinationType As Type) As Boolean
            Return False
        End Function

        Public Overridable Function ConvertFrom(ByVal value As Object) As Object
            Return value
        End Function

        Public Overridable Function ConvertTo(ByVal value As Object, ByVal destinationType As Type) As Object
            Return Nothing
        End Function

        Public Overridable Function GetStandardValues() As ICollection
            Return Nothing
        End Function

        Public Overridable Function GetStandardValuesExclusive() As Boolean
            Return False
        End Function

        Public Overridable Function IsValid(ByVal value As Object) As Boolean
            Return False
        End Function

        Protected Overridable Function GetConvertFromException(ByVal value As Object) As Exception
            Return Nothing
        End Function

        Protected Overridable Function GetConvertToException(ByVal value As Object, ByVal destinationType As Type) As Exception
            Return Nothing
        End Function

    End Class

End Namespace